<{include file="../common/header.tpl"}>
<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
            <{include file="../common/left.tpl"}>
    </td>
    <td width="87%" valign="top">
        
        <table width="100%" border="0" cellspacing="0">
                <tr>
                <td>
                    <form name="form1" method="get" action="/webadmin/group/list">
                    <div class="subnav">
                        <div class="content-menu ib-a blue line-x">
                        <a href="#" class="on"><em>用户组管理</em></a><span>|</span><a href="/webadmin/group/add"><em>添加用户组</em></a>
                        <input type="text" value="<{$group_name}>" class="input-text" name="group_name" style="margin-left:30px;"><input type="submit" value="搜索" class="button" name="dosubmit">
                        <div class="clearbox"></div>  
                         </div>
                    </div>
                    </form>
              <div class="pad_10">
                <div class="table-list">
                <table width="100%">
                      <thead>
                        <tr>
                            <th>用户组名</th>
                            <th>用户组描述</th>
                            <th>具体权限</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                      </thead>
                      <tbody>
                        <{foreach $list as $key => $val}>
                        <{if $val.group_id!=1}>
                        <tr  onMouseOver="this.className='tr2'" onMouseOut="this.className='tr1'" class="tr1" id="group_<{$val.group_id}>">
                            <td align="center"><{$val.group_name}></td>
                            <td align="center"><{if $val.group_describe}><{$val.group_describe}><{else}>无<{/if}></td>
                            <td style="width:50%">
                                <{foreach $auth as $kk=> $vv}>
                                    <{if $vv.sub}>
                                    <{foreach $vv.sub as $k => $v}>
                                        <{if $val['group_auth']=='*'||$v.action|check_auth:$val['group_auth']}><{$v.name}>，<{/if}>
                                    <{/foreach}>
                                    <{/if}>
                                <{/foreach}>
                            </td>
                            <td align="center"><{$val.create_time|date_format:"%Y-%m-%d"}></td>
                            <td align="center">
                                <a href="/webadmin/user/list?group_id=<{$val.group_id}>">成员管理</a> | 
                                <a href="/webadmin/group/edit?group_id=<{$val.group_id}>">修改</a> | 
                                <a href="javascript:;" onclick='del(<{$val.group_id}>)'>删除</a></td>
                        </tr>
                        <{/if}>
                        <{/foreach}>
                         
                      </tbody>
                </table>
                        <div style="float:right;"><{$page}></div>
                </div>
              </div>
    </td>
 </tr>
</table>
<script type="text/javascript">
    function del(group_id){
        if (confirm('确定删除？')) {
            $.getJSON('/webadmin/group/del',{group_id:group_id},function(res){
                if (res.status==1) {
                    $('#group_'+group_id).remove();
                }
                alert(res.note);
            });
        }
    }
    
</script>
<{include file="../common/footer.tpl"}>